<template>
	<view>
		<index v-if="PageCur=='basics'"></index>
		<user v-if="PageCur=='component'"></user>
		<view class="cu-bar tabbar bg-white shadow foot">
			<view class="action" @click="NavChange" data-cur="basics">
				<view class='cuIcon-cu-image'>
					<image :src="'/static/tabbar/basics' + [PageCur=='basics'?'_cur':''] + '.png'"></image>
				</view>
				<view :class="PageCur=='basics'?'text-green':'text-gray'">元素</view>
			</view>
			<view class="action" @click="NavChange" data-cur="component">
				<view class='cuIcon-cu-image'>
					<image :src="'/static/tabbar/component' + [PageCur == 'component'?'_cur':''] + '.png'"></image>
				</view>
				<view :class="PageCur=='component'?'text-green':'text-gray'">组件</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
		return {
				PageCur: 'basics'
			}
		},
		methods: {
			NavChange: function(e) {
				this.PageCur = e.currentTarget.dataset.cur
			},
			charge(){
				uni.requestPayment({
				    provider: 'wxpay',
				    timeStamp: res.timeStamp,
				    nonceStr: res.nonceStr,
				    package: res.package,
				    signType: 'MD5',
				    paySign: res.paySign,
				    success: function (res) {
				        // console.log('success:' + JSON.stringify(res));
						uni.showToast({
						    title: '支付成功',
							icon: 'none',
						    duration: 2000
						});
				    },
				    fail: function (err) {
				        // console.log('fail:' + JSON.stringify(err));
						uni.showToast({
						    title: '支付失败',
							icon: 'none',
						    duration: 2000
						});
				    }
				});
			}
		},
		onLoad(option) {
			console.log("option")
			console.log(option)
		}
	}
</script>

<style>

</style>
